/*
 *  $Id: HelpRegion.cs 925 2009-12-02 12:50:02Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008-2009 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

using AgateLib.Geometry;

namespace Ragima {
    public abstract class HelpRegion: Region, IHelpProvider {
        public HelpRegion(Rectangle rect): base(rect) {}

        public abstract IHelpProvider HelpObject { get; }

        public override void OnMouseEnter() {
            base.OnMouseEnter();
            Game.Current.Help = this;
        }

        public override void OnMouseLeave() {
            base.OnMouseLeave();
            Game.Current.Help = null;
        }

        public virtual bool DrawHelp(int x, int y) {
            IHelpProvider help = HelpObject;
            return help != null ? help.DrawHelp(x, y) : false;
        }
    }
}
